#ifndef CANON_H
#define CANON_H

#include <iostream>
#include <SFML\Graphics.hpp>
#include <SFML\Window.hpp>
#include "roquette.h"

class Canon
{
    public:
    Canon();
    ~Canon();
    void SetCaracter(sf::Vector2f position,sf::Vector2f positionflip, std::string image, sf::IntRect subRect, Roquette roquette);
    void ChangerAngle(int angle, bool egal);
    void Tir(int angle, float puissance, sf::Vector2f positiontank, sf::Vector2f vent, bool flip);
    void Rafraichir(sf::Vector2f positiontank, float angletank, bool flip);
    void Afficher(sf::RenderWindow *app, Terrain *terre, bool visible);
    bool GetExplosion();
    int GetAngle();
    void Flip(bool flip);
    sf::Vector2f GetRoquettePosition();
    void DeplacerRoquette(sf::Vector2f vent, Terrain *terre, Game *jeu, std::vector<sf::Sprite> unite);
    Canon& operator=(const Canon &canon2);
    Roquette *m_munition;

    private:
    float m_angle;
    float m_t, m_tflip, L, Lflip;
    bool m_bexplosion;
    sf::SoundBuffer m_buffertircanon;
    sf::Sound m_soundtircanon;
    sf::Vector2f m_position, m_positiontir;
    sf::Texture m_imagecanon;
    sf::Sprite m_spritecanon;
};

#endif
